home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / workbench / tools / czesc_1 / dr / dr.doc < prev    next >
Text File  |  1993-11-21  |  30KB  |  536 lines

  1.  
  2.                                    DR 2.0
  3.  
  4. What we got here is Yet Another CLI Directory Listing Command, called Dr
  5. (pronounced "dr", one syllable) because it leaves out .info files.  (Like,
  6. the missing I in Dir stands for .info ...? never mind.)  It is a very fast
  7. and full featured program for AmigaDOS 2.04 and up which is arguably superior
  8. to all of the dozen or so other Amiga directory listers I've seen.  The
  9. features it offers are:
  10.  
  11.   + By default, .info files are not mentioned in the output.  Instead, it
  12.     shows you which files have *.info files associated with them by writing
  13.     their names in orange (or whatever you have set color 3 to be), unless
  14.     you use the -M option (for Monochrome).  Any *.info file that is not
  15.     associated with a regular file or directory is shown normally, e.g.
  16.     Disk.info.  You can see all *.info files normally with the -I option.
  17.  
  18.   + It is fully reentrant and reexecutable.  The "pure" bit is set; you can
  19.     make it resident.  Some previous versions would not pass stringent purity
  20.     tests; this one does.
  21.  
  22.   + It is faster than other directory listers, including older versions of
  23.     Dr.  The speed advantage is biggest when more than one directory is
  24.     listed.  Note that this version no longer uses the fastscan.library that
  25.     was included with some older releases, so you can probably delete that.
  26.  
  27.   + It arranges the output in a variable number of columns, with spacing
  28.     based on both the length of the longest filenames and the width of the
  29.     window.  It assumes a width of 77 when output is not going to a CON:
  30.     window.  By default, it sorts the entries in columns, not in rows; it's
  31.     easier to find things alphabetically that way (try it out if you don't
  32.     think so).  The -H option makes it sort in rows.  Directories are listed
  33.     with slash characters after their names.  By default, directories are
  34.     listed before files, and inner directory contents before outer when full
  35.     depth listings are done, but these can be reversed with an output style
  36.     option that can also adjust several other cosmetic items.
  37.  
  38.   + Sorting is aware of international alphabets as of Dr 1.6; it will sort
  39.     "Mädchen" after "madam" but before "madman".
  40.  
  41.   + It handles AmigaDOS wildcard patterns, like "#?.(c|o)" to list all files
  42.     with names ending in ".c" or ".o".  Those of you who hate "#?" can use
  43.     "*" instead, if you activate the AmigaDOS WILDSTAR flag to do this.  The
  44.     NathanHale program included with Dr (it's tiny, pure, and PD) switches
  45.     this feature on or off for all regular AmigaDOS programs, as well as Dr.
  46.     Starting with Dr 2.0, wildcards can be used in all levels of a pathname,
  47.     for example "sys:work/#?/source/#?.c".
  48.  
  49.   + It understands file links.  When the -L option is used, it shows what
  50.     each soft link is linked to, in an extra line after the regular
  51.     information for that file.  Using the -X option on a soft link tells the
  52.     pathname that it is linked to, but no other information (this is due to a
  53.     limitation of AmigaDOS).  In normal output, soft links are grouped with
  54.     directories but do not have slashes on the ends of their names as
  55.     directories do.  Hard links do not at present get any special treatment,
  56.     except that Dr will notice if a directory is linked "inside itself".  Dr
  57.     will NOT read soft links in RAM:, except for using -X on a single link,
  58.     because the Ram-Handler will sometimes blow shrapnel around your system
  59.     when you try that.  (Note: if you list a directory containing a hard
  60.     link, you will not see any filenote on it, but if you ask for a listing
  61.     of just that link, perhaps by using the -X option, you may see one.  This
  62.     is the fault of the filesystem, not Dr.)
  63.  
  64.   + It has lots of genuinely useful options.  There isn't much one could ask
  65.     of a directory lister that Dr can't somehow accomplish.
  66.  
  67.   + And last but certainly not least, Dr is public domain and the source
  68.     code is included.
  69.  
  70. USAGE:  type "Dr" followed by zero or more file names, directory names,
  71. patterns, or options, or type "Dr ?" for a summary of options.  Anything that
  72. starts with a dash character and is not enclosed in quotes is taken as
  73. options.  Example:
  74.  
  75.   dr -orf devs:
  76.  
  77. In this command, "devs:" is the directory that gets listed, and the set of
  78. options is "-orf".
  79.  
  80. By default, Dr lists the names of files and subdirectories in whatever
  81. directories you tell it to list, alphabetically sorted in columns.  It's
  82. usually easier to find something alphabetically by reading down columns
  83. instead of across rows, in my experience.  If you disagree, use the -H option
  84. (H for "horizontal").  Directory names are listed before file names, with the
  85. filenames indented one space.  (This method of visibly separating them
  86. replaces that stupid line of dashes that many users disliked.)  Each
  87. directory name is followed by a slash.  Only the name itself, not the slash,
  88. is orange if it has an icon.  Things with associated *.info files will be
  89. marked as such even if the *.info file itself is excluded by the pattern you
  90. used, or by the -D or -A or -B options.  If you list just a single file, it
  91. will check whether it has a *.info file and show the name in the alternate
  92. color if so, unless you use the -I (show .infos) or -M (monochrome) option.
  93. It does not check to see whether files with names ending in .info are actual
  94. valid icon files.  Note that if the output is not a CON: window, it is as if
  95. -M were used; it doesn't show you which files had icons.
  96.  
  97. New in release 1.5 is an extension of pattern syntax:  If you end the pattern
  98. with a double colon, it applies that pattern to files within all of the
  99. subdirectories it encounters, as well as the directory you specify.  You can
  100. think of "pattern::" as being equivalent to "pattern" and "#?/pattern" and
  101. "#?/#?/pattern" and so on.  This is different from using the -R option (show
  102. contents of subdirectories) with a pattern.  With -R, it shows files in the
  103. top directory that fit the pattern, and looks in each subdirectory with a
  104. name that fits the pattern, showing all the files inside.  With "::" it looks
  105. in all subdirectories and shows the items in them that match the pattern.
  106. The "::" can be used only at the very end of a path/pattern specification,
  107. not in the middle.  That is, "#?/source/#?.c::" is legal but something like
  108. "work#?::/#?.doc" is not.
  109.  
  110. -R will also search the contents of directories which are not shown, if the
  111. reason they are not shown is because of the -A, -B, -F, or -P options, rather
  112. than because of a pattern.  Those options will limit which files are shown
  113. within those subdirectories.
  114.  
  115. If you specify an actual directory that has a name with pattern characters in
  116. it, like maybe a drawer named "Doesn't work?", Dr will list that directory
  117. instead of expanding the pattern.  You can force it to expand by adding an
  118. extra percent sign to the pattern, so it doesn't match the name.  Patterns at
  119. the end of a pathname may be up to 128 characters long.
  120.  
  121. If you wish to use a single question mark as a pattern to show all files with
  122. one-character names, and there are no other arguments on the command line,
  123. you must put quotes around it or add a percent-sign to it, or Dr will think
  124. you are asking it for a brief summary of usage and options.  As of Dr 1.5,
  125. the way to specify a quote within quotes is with "" rather than the AmigaDOS
  126. standard *", in order to make it easier to use the asterisk as a wildcard.
  127.  
  128. You can give several option letters after one dash, like "Dr -chs foo", or
  129. separately, like "Dr -c -h foo -s".  The case of the option letters doesn't
  130. matter.  Each option affects those files and directories that come after it
  131. on the command line, except that any options at the end, after the last
  132. filename, act as if they were entered at the beginning.  Example:  "dr foo -s
  133. bar" lists directory foo without showing sizes, and directory bar with sizes
  134. shown.  If a directory name begins with a dash, put quotes around so that it
  135. isn't taken as options.  If you give an option twice, the second one cancels
  136. the first.  This means that if you make an alias like "alias list dr -lc []",
  137. saying "list -c" turns the -c option off.  Or, you can show directory foo
  138. with sizes, and directory arf without sizes, with the command "Dr -s foo -s
  139. arf".  (Note: since options at the end act like they are at the beginning,
  140. "Dr -s directory -s" will show the directory without the -s option!)
  141.  
  142. Options can also be given by setting the environment variable DR-OPTS.  It
  143. can contain any option or options from the list below, including custom
  144. format strings.  They are checked before looking at any of the options on the
  145. command line.  Local shell variables set with "Set" take precedence over
  146. global ENV: variables set with "SetEnv".  Options on the command line can
  147. reverse the ones in DR-OPTS.  The command line option -@ makes it ignore the
  148. DR-OPTS variable.  Hyphens before options are allowed, but not needed, in
  149. DR-OPTS.  It can be up to 287 characters long.  So for example, if you want
  150. to make Dr always use the options "-I" and "-P^H" and "-N12" except when you
  151. tell it otherwise, give these commands:
  152.  
  153.     setenv DR-OPTS "i p^h n12"
  154.     copy env:DR-OPTS envarc:
  155.  
  156. The second command saves the environment variable so it will be automatically
  157. restored when you reboot or turn on the machine.
  158.  
  159. The complete set of options for Dr release 2.0 is:
  160.  
  161.     -I  List .info files like normal files instead of using an alternate
  162.         color to mark the other files they are associated with.
  163.  
  164.     -M  Turns off the use of color to mark files that have icons.  Color is
  165.         not used anyway when output is redirected to a file.
  166.  
  167.     -S  Show the size of each file in bytes, and totals.  The number of
  168.         spaces allowed for each number is based on the largest value found in
  169.         the output, except in unsorted mode (when -O is used) where nine
  170.         characters are allowed.
  171.  
  172.     -C  Sort chronologically (newest last) instead of alphabetically.
  173.  
  174.     -Z  Sort by file size, from smallest to largest.  Items of equal size,
  175.         such as directories, are sorted alphabetically or chronologically
  176.         depending on presence of -C.
  177.     
  178.     -V  Sort in reverse (Z to A, newest to oldest, or largest to smallest).
  179.  
  180.     -H  Sort into rows instead of columns, if more than one column.
  181.  
  182.     -L  Show sizes, protection bits, datestamps and filenotes like the List
  183.         command.  Overrides -S.  Show total bytes/blocks used.  Unlike List,
  184.         it puts the filename after the other information instead of before.
  185.         For soft links it adds an extra line telling what path it is linked
  186.         to.  Output is sorted unless you also use the -O option.
  187.  
  188.     -Y  Use day names like "Today" or "Yesterday" or "Monday" to show dates
  189.         within the last week, the way List does if you don't use its DATES
  190.         option.  This applies to "\t" substitutions (see below) also.
  191.  
  192.     -D  Do not show file names, only subdirectory names.  Cancels -F.
  193.  
  194.     -F  Do not show subdirectory names, only file names.  Cancels -D.
  195.  
  196.     -K  Show the disk address (header block key) of each file or directory,
  197.         in square brackets.  As with -S, the spacing allowed for the number
  198.         is based on the largest value shown, except when output is unsorted
  199.         (-O).  In that case six spaces are allowed.
  200.  
  201.     -R  Recursively show contents of all subdirectories found.  If you're
  202.         going to descend a whole lot of levels (like more than about nine)
  203.         you will need a bigger stack than the default 4K.  It checks for
  204.         adequate stack before entering each subdirectory.  An 8K stack would
  205.         let you go about 40 levels deep.
  206.  
  207.     -U  Show only disk space consumed, and a count of files and directories,
  208.         without listing any names unless you also use -O or custom
  209.         formatting.  As far as output goes, -U overrides all other options
  210.         except -R, -O, and custom formatting, but patterns and options may
  211.         affect the totals shown.
  212.  
  213.     -O  Put each filename on a separate line as a complete pathname, do not
  214.         sort, do not hide .info files, and when -R is used merge all the
  215.         directories and subdirectories into a single list.  If -L is also
  216.         used, size and protection and such is shown, and totals are given at
  217.         the end, with no subtotals for inner directories.  With -L, names are
  218.         shown as relative pathnames from the directory specified, including
  219.         inner dir names if -R is used, not as complete pathnames.  Using -U
  220.         with -O also causes totals to be shown at the end, but leaves the
  221.         output in the form of one complete name per line.  If neither -L nor
  222.         -U is used, there are no headers to separate directories, just
  223.         nothing but names.  This can be very useful as input to other
  224.         programs.  Overrides -S, -K, -C, and lack of -I.  -N is overridden in
  225.         most ways but still affects whether inner directories are listed
  226.         after outer ones, as opposed to being listed somewhere in the middle.
  227.         The beginning of the pathname shown is the directory arg as you
  228.         specified it in the command, not the absolute path, unless you use
  229.         -T.  The pathnames output have a maximum length of 300 characters.
  230.         Output is continuous while the disk is being scanned, instead of done
  231.         afterwards.  Unsorted output can be noticeably faster, because the
  232.         disk IO is asynchronous.
  233.  
  234.     -T  Convert the pathnames you give it to absolute form.  For instance, if
  235.         you say "Dr -o env:" it will normally write lines of filenames like
  236.         "env:Kickstart".  But "Dr -ot env:" will say "Ram Disk:env/Kickstart"
  237.         or the like; "env:" is converted into its true pathname.
  238.  
  239.     -X  Show the specified directory's information as if it were listed as
  240.     part of its parent directory, instead of showing the files inside.
  241.     Unless -O or custom formatting is used, show its protection bits,
  242.     datestamp, and so on as if listed with -L.  If an arg is a soft link
  243.     instead of a directory, show the pathname that it is linked to; the
  244.     datestamp and such are not shown in this case due to a limitation of
  245.     the Amiga filesystem.  Ignored if -R or a pattern at the end of the
  246.     argument is used.  Overrides -F, -D, and -P.
  247.  
  248.     -A# (example: -A30)  Show all files dated within the last # days.  The
  249.         cutoff point is midnight before the day # days ago.  Thus -A0 shows
  250.         files changed today.  -A not followed by a digit cancels it.
  251.  
  252.     -B# (example: -B5)  Like -A, but show all files more than # days old.
  253.         Combining -A with -B uses a range of days, or excludes a range of
  254.         days if the -A number is smaller (more recent) than the -B number.
  255.  
  256.     -N# (example: -N2)  Select a general style for how directories and files
  257.         are arranged in the output.  The default is 0, which specifies that
  258.         files should be listed immediately after directories, indented one
  259.         space more than directories.  1 specifies a blank line in between,
  260.         and no difference in indentation.  2 is like 1 except with a line of
  261.         dashes in place of the blank line.  3 specifies that files and
  262.         directories are combined into a single sorted list.  You can add ten
  263.         to any of those numbers (e.g. -N12), and that tells it that files are
  264.         to be listed before directories rather than after.  This also causes
  265.         the contents of inner directories to be listed after, rather than
  266.         before, their parent directories.  This also causes inner directory
  267.         listings to appear in properly sorted order, which they cannot do
  268.         when listed before their parents, and might be a trifle faster.
  269.         Other values produce a nonfatal error message.
  270.  
  271.     -P...
  272.         A bit more complicated than the options above; the letter P may have
  273.         other letters after it, each one optionally preceded by a tilde (~).
  274.         The letters allowed are H, S, P, A, R, W, E, or D (lowercase okay).
  275.         These letters represent protection bits.  If the tilde is in front of
  276.         a letter, Dr will show only files for which that protection bit is
  277.         not set.  If there is no tilde it will show only those for which it
  278.         is set.  For instance, to show all "pure" files, use -PP.  To show
  279.         all script files which have not been backed up, use -PS~A.  Use -P
  280.         with a space after it to cancel earlier -P options, making it ignore
  281.         protection bits.  For the bits R, W, E, and D, "set" means that the
  282.         bit shows as present when you use List or Dr -L.  (The physical bit
  283.         is actually a zero in these cases.)  So for example -P~D means show
  284.         files protected from deletion.  You can use a caret (^) instead of a
  285.         tilde (~) if you want.  Must not be followed by another option
  286.         letter; that is, you can't use -PAU for -PA -U.
  287.  
  288.     -[...format string...]
  289.         Control the format of the output.  For each file or directory to be
  290.         listed, the text inside the brackets is written out followed by a
  291.         newline.  Substitutions can be made in that text, by including a
  292.         backslash character followed by one other character to indicate what
  293.         to insert, optionally with digits in between.  The digits are ignored
  294.         for most substitutions, but when a number (for instance) is inserted,
  295.         the digits specify how many text columns to use.  For substitutions
  296.         that produce a decimal number (\s and \k), spaces are added on the
  297.         left if the number of digits to be written is less than the specified
  298.         width, and if the number of digits given is insufficient for the
  299.         number's digits, they're all written out anyway.  The complete list
  300.         of substitutions is:
  301.            \n is replaced with a newline.
  302.            \e is replaced with an escape character.
  303.            \d is replaced with the name of the directory being searched.
  304.                (If you specified a file instead of a dir, or used -X, \d will
  305.                give the full name, and any filename pasted on after it will
  306.                be invalid.)
  307.            \f is replaced with the name of the current file or directory
  308.                being listed, with no path in front.
  309.            \p is replaced with the pathname of the current file or directory;
  310.                like \d followed by \f, with a slash in between if needed.
  311.            \? becomes a slash if the current file is a directory, or a colon
  312.                if it is a volume (with -X option), or nothing for files.
  313.                Usually used right after \f or \p to show whether it is a
  314.                directory.
  315.            \/ is a slash unless the preceding character output was a slash,
  316.                colon, double-quote, whitespace, or control character.
  317.                Possibly useful for joining filenames onto directory names.
  318.            \b is replaced with the file's protection bits, shown as eight
  319.                letters or dashes; e.g. "-s-arw-d".
  320.            \t is replaced with the file's timestamp, in the format
  321.                "DD-Mmm-YY HH:MM:SS".  (No choice of date format yet.)  If a
  322.                number is given (for example "\9t"), then if the number is
  323.                less than 18, the date is truncated on the right after that
  324.                many characters, and if more than 18, then extra spaces are
  325.                added on the left to produce the desired number of characters.
  326.            \w is replaced with the day of the week that the file's datestamp
  327.                falls on.  As with \t, the name is padded on the left if you
  328.                give a width greater than 9, and truncated if you give less.
  329.                This means that "\3w" can be used to produce a three letter
  330.                abbreviation like "Mon" or "Wed".
  331.            \s is replaced with the file's size in bytes, or blanks for a
  332.                directory.  If no width is specified, the default width is 9
  333.                characters.
  334.            \k is replaced with the disk address (key) of the file or
  335.                directory, padded to a constant width.  If no width is
  336.                specified, the default width is 6 characters.
  337.            \i is replaced by (n) spaces, where (n) is how many levels deep in
  338.                recursive descent you are -- no spaces when no recursion.  If
  339.                a width is included (e.g. "\4i") then the recursion depth is
  340.                multiplied by that number to give the number of spaces written.
  341.            \+ prevents the newline at the end of each output.
  342.            \ before anything else "quotes" it.  Use \\ for \ and \] for ].
  343.         To cancel a previous format option and use normal output from now on,
  344.         use -[].  Overrides -S, -L, and -K.  Output is sorted normally, and
  345.         has the usual headers to separate subdirectories and different
  346.         directories given on the command line, and (with -N1 or -N2) the
  347.         usual blank line or line of dashes, unless you use -O also.  Note
  348.         that whitespace and double-quotes inside -[...] are treated as
  349.         literal text, not as marking separate arguments to Dr.  The text that
  350.         is output after substitutions is limited to 255 characters.  The name
  351.         written by \p or \f will be in the cursor color (orange or whatever)
  352.         if it has an icon, unless you use -I or -M or -O or redirect the
  353.         output to a file.
  354.  
  355.     -{... format string...}
  356.         Like -[...], except it executes the result as an AmigaDOS command
  357.         instead of just writing it out.  (Use \} if you need a } in the
  358.         command.)  This is done in addition to, not instead of, normal
  359.         output.  So you can use both -[...] and -{...} at once with different
  360.         formats.  The command is done first, the output last.  In fact,
  361.         commands are executed during the disk scan instead of saved until
  362.         afterwards, so they are done in unsorted order.  You can use -o[\+]
  363.         to suppress all output and just run commands.
  364.  
  365. These next few options, which are punctuation characters instead of letters,
  366. differ from the above in that they take global effect if they appear anywhere
  367. on the command line, and do not toggle.
  368.  
  369.     -@  Causes Dr to ignore the DR-OPTS environment variable and use the
  370.         default "factory" option settings.
  371.  
  372.     -?  Test whether any files asked for can be found.  Produce no output
  373.         of any kind, but return 5 (WARN) and error 205 (object not found) if
  374.         nothing is found that matches the arguments given.  Return 0 if
  375.         anything is found to match any file, dir, or pattern argument.
  376.         Overrides all options controlling output.  Also overrides -{}, since
  377.         it stops as soon as it finds even one match.
  378.  
  379.     -!  Turn off the cursor during output to the screen.  Text gets written
  380.         somewhat faster this way.
  381.  
  382. Here is a brief list of mnemonic words that might help you remember which
  383. option is which:
  384.  
  385.     -A = After        -B = Before       -C = Chronological  -D = Dirs only
  386.     -F = Files only   -H = Horizontal   -I = include Icons  -K = Keys
  387.     -L = List Long    -M = Monochrome   -N = style Number   -O = name Only
  388.     -P = Protection   -R = Recursive    -S = Size           -T = True name
  389.     -U = Usage        -V = reVerse      -X = eXternal       -Y = Yesterday
  390.     -Z = by siZe      -! = zoom!        -? = exists?        -@ = v@nilla
  391.  
  392. If Dr lists the contents of more than one directory, each one will be
  393. preceded with its name, written like this:
  394.  
  395.         ===  path/whatever/dir  ===
  396.  
  397. unless you use -O (but not -U or custom formatting) in which case the
  398. different listings will all run together without separation.  If you give no
  399. directory or pattern, it lists the current directory, of course.  Or you can
  400. specify the current directory as empty quotes: "".
  401.  
  402. If you give it a multiply assigned name, it will produce separate sections
  403. for each directory the name is assigned to, with banners like the one shown
  404. above for each one.  It can handle up to fifty assignments on one name.  For
  405. example, assume that you have FONTS: assigned to two directories named
  406. "Workbench:fonts" and "Work:etc/MoreFonts".  If you give the command "Dr
  407. fonts:t#?.font" you might get output like this:
  408.  
  409.         === Workbench:fonts ===
  410.  topaz.font
  411.  
  412.         === Work:etc/MoreFonts ===
  413.  tallibm.font   times.font
  414.  
  415. Note that if you use -R or a "::" pattern with a multiply assigned name, and one
  416. of the assignments is a subdirectory of another, you may see some files listed
  417. twice.  Dr does not watch out for such overlaps, though it will catch cases in
  418. which a link makes a directory an ancestor of itself.  Also, if you name a
  419. subdirectory under the assigned name, which is present in more than one of the
  420. assigned directories, only the first one will be seen.  (Example: if there is
  421. a "Workbench:fonts/courier/18" and a "Work:etc/MoreFonts/courier/48", then
  422. listing "FONTS:courier" will only show the first.)  When -X is used, it will
  423. tell the protection and datestamp of each directory the name is assigned to.
  424.  
  425. The usage totals given at the end of a -S, -L, or -U output tell the number
  426. of directories listed, the number of files, the total number of bytes in the
  427. files, and the number of disk blocks they occupy.  For each of these numbers
  428. it may give a second number in parentheses.  This represents the total found
  429. in the whole directory, when it differs from the total of those selected for
  430. listing.  Things excluded by a pattern or by -A, -B, -D, -F, or lack of -I,
  431. may contribute to the differences between the numbers.
  432.  
  433. Some examples of using format strings:  to mark the files in directory foo as
  434. having been last updated yesterday, use
  435.  
  436.     Dr -o -{setdate "\p" yesterday} foo
  437.  
  438. The -o is not necessary but usually a good idea.  Or you might want to use
  439. -[\+] to suppress output.
  440.  
  441. To copy all files ending in ".c" in directory foo to directory bar with
  442. ".BAK" stuck on the end (foo/xxxxx.c becomes bar/xxxxx.c.BAK), use
  443.  
  444.     Dr -o -{Copy "\p" to "bar/\f.BAK"} foo/#?.c
  445.  
  446. WARNING:  Using Rename in the -{...} command may not work.  With at least
  447. some versions of some filesystems, such as RAM:, renaming a file and then
  448. looking up the "next" file in that directory after the one that just got
  449. moved, may get it very confused.  Better to use -[] to write the Rename
  450. commands to a temporary file and then Execute that file.  Similar cautions
  451. apply to Delete.
  452.  
  453. Some Un#@%!x folks like to list their files by simply going "echo *".  This
  454. writes out the names of the files packed all onto one line.  Well if you want
  455. to misuse Dr that way, you can:  (you'll probably want to use an alias)
  456.  
  457.     Dr -f -[\f \+] foo
  458.  
  459. That could be shortened to "Dr -f[\f \+] foo" ... with Dr 1.5 and newer,
  460. you can put letter options after the same dash as [] and {} options, before
  461. or after the brackets.  Dr will output a newline before it exits.
  462.  
  463. You can execute more than one command for each file by putting \n in between
  464. the commands inside -{ }.  Or alternatively, you can split the Dr command
  465. into multiple lines with a plus sign at the end of all but the last, and the
  466. newlines will be included in the bracketed command string.  (Plus-newline
  467. outside of brackets is considered the same as a space.)  But the complete
  468. text after all substitutions are made must be less than 256 characters long
  469. or Dr cannot execute it.  If a command comes out too long, Dr will write out
  470. a warning message and continue, and return 5 ("Warn") when it exits.
  471.  
  472. As an example of using more than one command separated by newlines, the
  473. following will type out all the files in directory foo with a header in front
  474. of each one:
  475.  
  476.     Dr -[\+] -{echo "*N  #### FILE \p -=>" \n type "\p"} foo
  477.  
  478. Or, alternatively:
  479.  
  480.     Dr -[\+]{echo "*N  #### FILE \p -=>" +
  481.     type "\p"} foo
  482.  
  483. At present, Dr quits whenever the command's return code is ten or more, but
  484. continues with nine or less.  Dr 1.5a and earlier quit when any nonzero
  485. return value occured.  A future version will have some way of setting a
  486. "Failat" level for such commands.
  487.  
  488. An example of using the -? option to test whether any files matching your
  489. criteria exist ... this command tests whether either directory Foo or
  490. volume Bar: has any files that need backing up, with the assumption that a
  491. file does not need backing up if the A protection bit is set or if its name
  492. ends in .o or .bak, and returns 5 if none do ... you can follow this in a
  493. script with "If WARN" to check whether the return was 5:
  494.  
  495.     Dr -?fp~a  Foo/~(#?.(o|bak))::  Bar:~(#?.(o|bak))::
  496.  
  497.  
  498. Some features I might add to future versions, maybe:
  499.  
  500.     The ability for the \f and \p formatting options to perform string
  501.     substitution on filenames, so that (for instance) FOO.TXT becomes
  502.     FOO.DOC.  This would be expressed with a syntax like \:::f or \:::p, for
  503.     example "\:.txt/:.doc:p".  The slash after ".txt" would indicate that it
  504.     must be found at the end of the name.  And more ways to split and combine
  505.     the starting pathname, the subdirectory under that, and the local name.
  506.  
  507.     -J: go ahead and jump into soft links when using -R.
  508.  
  509.     -G:  Show file's timestamp as age; days and hh:mm:ss before present.
  510.  
  511.     An option to control what format to display dates in.
  512.  
  513.     Make -A and -B able to parse date-and-time, e.g. "-A(5-Nov-93 16:00)".
  514.  
  515.     -Q:  Super-compact columnation like ls 4.1ljr, maybe.
  516.  
  517.     Make -X and -R both work at once.
  518.     
  519.     Maybe a variation of -T which substitutes the drive name for the volume
  520.     name.
  521.  
  522. Dr is in the public domain, written by Paul Kienitz.  Feature suggestions and
  523. bug reports are appreciated.  I can be reached at:
  524.  
  525.        snail: Paul Kienitz        bbses: Winners Circle     510-845-4812 
  526.               6430 San Pablo ave.        ("Paul M Kienitz" on that one)
  527.               Oakland, CA  94608         La Cantina (FAUG)  415-341-7566
  528.               USA                        The Mission        415-967-2021
  529.  
  530.      fidonet: "Paul Kienitz" at 1:125/28
  531.     internet: paul.kienitz@f28.n125.z1.fidonet.org
  532.  
  533. If you want the source and didn't get it with the executable, you should be
  534. able to download it from one of those bbses.
  535.  
  536.